package com.kotlin.myapplication.mvp.ui.start

import com.kotlin.myapplication.base.BaseActivity

/**
 *@lil
 *@创建时间 2019/10/30 16:54
 *@描述
 */
import java.lang.Thread.sleep
import android.content.Intent
import com.kotlin.myapplication.R
import com.kotlin.myapplication.mananger.APPSPManager

class StartActivity : BaseActivity() {


    override fun initView() {
        setContentView(R.layout.activity_start)
        Thread(object : Runnable {
            override fun run() {
                checkWelcome()
            }
        }).start()
    }

    fun checkWelcome() {

        try {
            sleep(2500)
        } catch (e: InterruptedException) {
        }
        if (APPSPManager.getleadPage()) {
            startActivity(Intent(this@StartActivity, MenuAcitivity::class.java))
            finish()
        } else {
            startActivity(Intent(this@StartActivity, LeadPageActivity::class.java))
            finish()
        }

    }
}